找传奇、传世资源到传世资源站!

蜗牛绕墙爬(python小游戏源码)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

游戏,蜗牛绕墙爬
from clipboard
from clipboard
speed=[5,0]
turtle_right=pygame.transform.rotate(turtle,90)
turtle_top=pygame.transform.rotate(turtle,180)
turtle_left=pygame.transform.rotate(turtle,270)
turtle_bottom=turtle
turtle=turtle_topwhile True:
    for event in pygame.event.get():
        if event.type==QUIT:
            sys.exit()
    position=position.move(speed)
    if position.right>width:
        turtle=turtle_right
        position=turtle_rect=turtle.get_rect()
        position.left=width-turtle_rect.width
        speed=[0,5]
    if position.bottom>height:
        turtle=turtle_bottom
        position=turtle_rect=turtle.get_rect()
        position.left=width-turtle_rect.width
        position.top=height-turtle_rect.height
        speed=[-5,0]
    if position.left<0:
        turtle=turtle_left
        position=turtle_rect=turtle.get_rect()
        position.top=height-turtle_rect.height
        speed=[0,-5]
    if position.top<0:
        turtle=turtle_top
        position=turtle_rect=turtle.get_rect()
        speed=[5,0]
    screen.fill(bg)
    screen.blit(turtle,position)
    pygame.display.flip()
    clock.tick(30)
       

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复